﻿Public Class frmTableViewer

    Dim source As DataTable

    Public Sub New(dt As DataTable)
        InitializeComponent()

        source = dt

    End Sub

    Private Sub frmTableViewer_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        dgData.DataSource = source
        lblRowCount.Text = String.Format("{0} Rows", dgData.RowCount)

    End Sub

End Class